# imports needed for functions below
import os
import time
import bots.botslib as botslib
import bots.botsglobal as botsglobal
from bots.botsconfig import *

# Name the output file same as input file
# channel must specify only "*" in filename
# syntax must contain 'merge':False
def filename(channeldict,ta,filename):
    ta.syn('botskey')
    if ta.botskey:
        return channeldict['filename'].replace('*',ta.botskey.replace('/','') + '-' +filename.replace('.edi',''))
    else:
        return filename